<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .btn {
      width: 100px;
      height: 100px;
      background-color: red;
    }
  </style>
</head>

<body>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  <!-- 引入样式 -->
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <!-- 引入组件库 -->
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  <div id="app">

  </div>
  <script>

    var app = new Vue({
      el: '#app',
      data: {


      },
      render (h) {
        return h('div', {
          class: {
            btn: true,
            'btn-success': this.type === 'success',
            'btn-danger': this.type === 'danger',
            'btn-warning': this.type === 'warning'
          },
          domProps: {
            innerText: this.text
          },
          on: {
            click: this.handleClick
          }
        })
      },
      created () {

      },
      mounted () {
      },
      methods: {
        handleClick() {
          console.log(1);
        },

      }
    }
    )
  </script>
</body>

</html>